
//---------------------------------------------------------------------------
#ifndef PG1_ANIMATION_H
#define PG1_ANIMATION_H
//---------------------------------------------------------------------------
#include "pg1_api.h"
#include <vector>
//---------------------------------------------------------------------------
namespace pg1
{
//---------------------------------------------------------------------------
class Timer;
//---------------------------------------------------------------------------
class PG1_API Animation
{
// constructor
public:
	Animation ();


// frames
public:
	struct Frame {
		float u1;	float v1;
		float u2;	float v2;
		float u3;	float v3;
		float u4;	float v4;
	};

	unsigned int currentFrame () const;
	const std::vector<Frame>& frames () const;
	void addFrame (float fTextureWidth, float fTextureHeight,
				   float fFramePosX, float fFramePosY,
				   float fFrameWidth, float fFrameHeight
	);
	
private:
	std::vector<Frame> m_akFrames;


// time
public:
	void setLength (float fLength);
	void update (Timer& rkTimer);

private:
	unsigned int m_uiCurrentFrame;
	float m_fCurrentTime;
	float m_fLength;
};
//---------------------------------------------------------------------------
#include "pg1_animation.inl"
//---------------------------------------------------------------------------
} // end namespace
//---------------------------------------------------------------------------
#endif // PG1_ANIMATION_H
//---------------------------------------------------------------------------
